Page({
  data: {
    listData: [
      {
        id: "1",
        danhao: "123001",
        date: "2018-10-28 12:00",
        address: "西湖区龙井路127号",
        facilityType: "城区管网",
        issueType: "排水管类",
        issueDescription: "排水管道淤积坍塌",
        img: "../../../images/river.png",
        img2: "../../../images/river.png",
        status: "处理中"
      },
      {
        id: "2",
        danhao: "123002",
        date: "2018-10-28 10:25",
        address: "杨公堤",
        facilityType: "城区管网58号",
        issueType: "井盖类",
        issueDescription: "井盖缺失",
        img: "../../../images/river.png",
        img2: "../../../images/river.png",
        status: "已保存"
      },
      {
        id: "3",
        danhao: "123003",
        date: "2018-10-26 13:00",
        address: "西湖区南山路100号",
        facilityType: "城区管网",
        issueType: "排水管类",
        issueDescription: "排水管道水溢出",
        img: "../../../images/river.png",
        img2: "../../../images/river.png",
        status: "已提交"
      },
      {
        id: "4",
        danhao: "123004",
        date: "2018-10-25 16:15",
        address: "西湖区桃源岭66号",
        facilityType: "城区管网",
        issueType: "雨水管类",
        issueDescription: "雨水管堵塞，水溢出",
        img: "../../../images/river.png",
        img2: "../../../images/river.png",
        status: "已完结"
      },
      {
        id: "5",
        danhao: "123005",
        date: "2018-10-23 12:00",
        address: "西湖区桃源岭66号",
        facilityType: "城区管网",
        issueType: "排水管类",
        issueDescription: "排水管道破损",
        img: "../../../images/river.png",
        img2: "../../../images/river.png",
        status: "已完结"
      },
      {
        id: "5",
        danhao: "123005",
        date: "2018-10-23 12:01",
        address: "西湖区桃源岭66号",
        facilityType: "城区管网",
        issueType: "排水管类",
        issueDescription: "排水管道破损",
        img: "../../../images/river.png",
        img2: "../../../images/river.png",
        status: "已完结"
      },
      {
        id: "5",
        danhao: "123005",
        date: "2018-10-23 12:01",
        address: "西湖区桃源岭66号",
        facilityType: "城区管网",
        issueType: "排水管类",
        issueDescription: "排水管道破损",
        img: "../../../images/river.png",
        img2: "../../../images/river.png",
        status: "已完结"
      },
      {
        id: "5",
        danhao: "123005",
        date: "2018-10-23 12:01",
        address: "西湖区桃源岭66号",
        facilityType: "城区管网",
        issueType: "排水管类",
        issueDescription: "排水管道破损",
        img: "../../../images/river.png",
        img2: "../../../images/river.png",
        status: "已完结"
      },
      {
        id: "5",
        danhao: "123005",
        date: "2018-10-23 12:01",
        address: "西湖区桃源岭66号",
        facilityType: "城区管网",
        issueType: "排水管类",
        issueDescription: "排水管道破损",
        img: "../../../images/river.png",
        img2: "../../../images/river.png",
        status: "已完结"
      },
      {
        id: "5",
        danhao: "123005",
        date: "2018-10-23 12:01",
        address: "西湖区桃源岭66号",
        facilityType: "城区管网",
        issueType: "排水管类",
        issueDescription: "排水管道破损",
        img: "../../../images/river.png",
        img2: "../../../images/river.png",
        status: "已完结"
      }
    ],
    x:10,
    y:540,
  },
  // //上报按钮拖曳事件
  // fnTouchMove: function (e) {
  //   let width = -this.reportWidth / 2;
  //   let height = -this.reportHeight / 2;
  //   let x = e.touches[0].clientX + width;
  //   let y = e.touches[0].clientY + height;
  //   if (x < width) {
  //     x = width
  //   }
  //   if (y < height) {
  //     y = height
  //   }
  //   if (x > this.windowWidth + width) {
  //     x = this.windowWidth + width;
  //   }
  //   if (y > this.windowHeight + height) {
  //     y = this.windowHeight + height;
  //   }
  //   this.setData({
  //     x,
  //     y,
  //   })
  // },
  fnMoveChange:function(e){
    
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this;
    //获取屏幕宽高
    wx.getSystemInfo({
      success: function (res) {
        that.windowHeight = res.windowHeight;
        that.windowWidth = res.windowWidth;
      }
    });
    //判断上报按钮的显隐
    if (options.reportShow) {
      this.setData({
        reportShow: options.reportShow
      })
    }
  },

  // 跳转到详情页
  toIssueDetail: function (e) {
    wx.navigateTo({
      // 使用JSON.stringify(object)将object转化为字符串
      url: "./issue_detail/issue_detail?item=" + JSON.stringify(e.currentTarget.dataset.obj)
    })
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
    var that = this;
    //获取元素上报按钮的宽高
    let query = wx.createSelectorQuery();
    query.select('.report_issue').boundingClientRect(function (rect) {
      if(!rect){
        return;
      }
      that.reportHeight = rect.height;
      that.reportWidth = rect.width;
    }).exec();
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})